import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/http_data.dart';
import 'package:app/src/http/bean/wroks/address_bean.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/ui/route/helper/route_helper.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';

import '../../../../../../http/bean/worksdo/equipment_management_bean.dart';
import '../../../../../../http/bean/worksdo/material_requisition_bean.dart';
import '../../../../../../http/bean/wroks/dispatchingaudit_bean.dart';
import '../../../../../../http/bean/ywx_limit.dart';
import '../../../../../../http/model/config_model.dart';
import '../../../../../app_ui.dart';
import '../../../../../dialog/dailog.dart';

///工单领用
class UiReceipt {
  ///data 信息
  ///oldData 历史信息
  static Widget build(BuildContext context, EquipmentInfo? data,
      EquipmentInfo? oldData, StateSetter setState,YwxItem item,
      {String? title}) {
    List<Widget> children = [];
    if (StringUtils.isEmpty(title)) {
      title = AppStrings.of(context).Receiptofworkorder; //工单领用
    }
    // children.add(UiBase.title(context, title)); //标题
    children.add(_ButtonReceiptofworkorder(context,data,item));
    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }

  ///工单领用
  static Widget _ButtonReceiptofworkorder(BuildContext context,EquipmentInfo? data,YwxItem item) {
    var btn= AppUi.materialButton(AppStrings.of(context).Receiptofworkorder+":"+AppStrings.of(context).Hardwarecollar,
        onPressed: () {
          AppDialog.showDialogWithReceiptofworkorder(context,data,item);
        });
    return Container(child: btn,alignment: Alignment.centerLeft,margin: EdgeInsets.only(bottom: 0),);
  }
}
